import { request } from '@/utils/http';

const api = {
	LOGIN: '/login',
	LOGIN_OUT: '/logout',
	REGISTER: '/register',
	FORGET_PASSWORD: '/forgetPass',
	UPGRADE_APP: '/version',
}

/**
 * 注册
 * @param params
 */
export const register = (params) => request.post(api.REGISTER, params, { custom: { auth: false } });

/**
 * 登录
 * @param params
 */
export const login = (params) => request.post(api.LOGIN, params, { custom: { auth: false } });

// 登出
export const logout = () => request.post(api.LOGIN_OUT, {});

/**
 * 获取最新版本
 * @param params
 */
export const upgradeApp = () => request.get(api.UPGRADE_APP, { custom: { auth: false } });